<?php

namespace app\index\service;

use app\index\dao\AccountBillDao;
use app\index\model\UM as UM;
use think\Collection;

/**
 * Class AccountBillService
 * @package app\index\service
 */
class AccountBillService
{
    // dao
    private AccountBillDao $accountBillDao;

    public function __construct(AccountBillDao $accountBillDao)
    {
        $this->accountBillDao = $accountBillDao;
    }

    /**
     * 列表
     * @param UM|null $user
     * @param int|null $page
     * @param int|null $page_size
     * @return Collection
     */
    public function index(UM $user, $isIncome, ?int $page = null, ?int $page_size = null): Collection
    {
        $member_id = $user->id;

        return $this->accountBillDao->selectBills($member_id, $isIncome, $page, $page_size);
    }

}
